import request from '@/modules/index/utils/request';
import qs from 'qs'
const store = {
  actions: {
    // 用户列表
    async userSearch (context, params) {
      const data = await request({
        url: '/user/search',
        method: 'get',
      });
      return data;
    },
    // 获取单个用户
    async userSearchByUsername (context, params) {
      const data = await request({
        url: '/user/search-by-username',
        method: 'get',
        params: params
      });
      return data;
    },
    // 登录接口
    async userLogin (context, params) {
      const data = await request({
        url: '/login?' + qs.stringify(params),
        method: 'post',
      });
      return data;
    },
  }
};

export default store;
